home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / SourceCode / Tutorial / Cookbook / 01b.hello.slider.Ch3Ex5 / MyObject.m < prev    next >
Text File  |  1995-06-12  |  508b  |  30 lines

  1.  
  2. /* Generated by Interface Builder */
  3.  
  4. #import "MyObject.h"
  5. #import <appkit/Control.h>
  6. #import <strings.h>
  7. #include <stdio.h>
  8.  
  9. @implementation MyObject
  10.  
  11. - setTextCell:anObject
  12. {
  13.     textCell = anObject;
  14.     return self;
  15. }
  16.  
  17. - slider:sender
  18. {
  19.     strcat(myString, "\nhello, world, slider = ");
  20.     myFloat = [sender floatValue];
  21.     sprintf(tmp, "%f", myFloat);
  22.     printf("myFloat = %f, tmp = \"%s\"\n", myFloat, tmp);
  23.     strcat(myString, tmp);
  24.     [textCell setStringValue:myString];
  25.     return self;
  26. }
  27.  
  28.  
  29. @end
  30.